<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <title>写下你的留言</title>
    <link th:href="@{/css/bootstrap.css}" rel='stylesheet' type='text/css' />
    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <!-- Custom Theme files -->
    <link th:href="@{/css/style.css}" rel='stylesheet' type='text/css' />
    <!-- Custom Theme files -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="keywords" content="Hotel Deluxe Responsive web template, Bootstrap Web Templates, Flat Web Templates, Android Compatible web template,
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyEricsson, Motorola web design" />
    <script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
    <!--webfont-->
    <script type="text/javascript" th:src="@{/js/jquery-1.11.1.min.js}"></script>
    <script type="text/javascript" th:src="@{/js/login.js}"></script>
    <script th:src="@{/js/jquery.easydropdown.js}"></script>
    <!--Animation-->
    <script th:src="@{/js/wow.min.js}"></script>
    <link th:href="@{/css/animate.css}" rel='stylesheet' type='text/css' />
    <link rel="stylesheet" th:href="@{/bower_components/font-awesome/css/font-awesome.min.css}">
    <!-- Ionicons -->
    <link rel="stylesheet" th:href="@{/bower_components/Ionicons/css/ionicons.min.css}">
    <!-- DataTables -->
    <link rel="stylesheet" th:href="@{/dist/css/AdminLTE.min.css}">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" th:href="@{/dist/css/skins/_all-skins.min.css}">
    <script>
        new WOW().init();
    </script>
</head>
<body>
<div class="header">
    <div class="col-sm-8 header-left">
        <div class="logo">
            <a href="index.html"><img th:src="@{/images/logo.png}" alt=""/></a>
        </div>
        <div class="menu">
            <a class="toggleMenu" href="#"><img th:src="@{/images/nav.png}" alt="" /></a>
            <ul class="nav" id="nav">
                <li><a th:href="@{/toUserLogin}">首页</a></li>
                <li><a th:href="@{/toRooms}">房间</a></li>
                <li><a href="news.html">新闻</a></li>
                <li><a th:href="@{/toGallery}">旗下酒店</a></li>
                <li><a href="/userOrder/userorder">我的订单</a></li>
                <li><a th:herf="active">个人中心</a></li>
                <li><a href="404.html">社区</a></li>
                <div class="clearfix"></div>
            </ul>
            <script type="text/javascript" th:src="@{/js/responsive-nav.js}"></script>
        </div>
        <!-- start search-->
        <div class="search-box">
            <div id="sb-search" class="sb-search">
                <form>
                    <input class="sb-search-input" placeholder="请输入你要查询的关键字" type="search" name="search" id="search">
                    <input class="sb-search-submit" type="submit" value="">
                    <span class="sb-icon-search"> </span>
                </form>
            </div>
        </div>
        <!--search-scripts-->
        <script th:src="@{/js/classie.js}"></script>
        <script th:src="@{/js/uisearch.js}"></script>
        <script>
            new UISearch( document.getElementById( 'sb-search' ) );
        </script>
        <!--search-scripts-->
        <div class="clearfix"></div>
    </div>
    <div class="col-sm-4 header_right">
        <div id="loginContainer"><a href="#" id="loginButton"><img th:src="@{/images/login.png}">
            <span th:if="${session.user != null}" th:text="${session.user.userName}">登录</span>
            <span th:if="${session.user == null}" >登录</span>
        </a>
            <div id="loginBox">
                <form id="loginForm" th:action="@{/userLogin/login}" method="post">
                    <fieldset id="body">
                        <fieldset>
                            <label for="userName">用户名</label>
                            <input type="text" name="userName" id="userName">
                        </fieldset>
                        <fieldset>
                            <label for="password">密码</label>
                            <input type="password" name="userPassword" id="password">
                        </fieldset>
                        <input type="submit" id="login" value="登录">
                        <input type="submit" id="regist" value="注册" ><a href="regist.html"></a>
                        <label for="checkbox"><input type="checkbox" id="checkbox"> <i>记住密码</i></label>
                    </fieldset>
                    <span><a href="#">忘记密码?</a></span>
                </form>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="clearfix"></div>
</div>

<div class="col-sm-4 header_right" style=" margin: auto;width: 100%">
    <div class="container_wrap">

                    <table class="table table-hover" id="mytable">
                        <thead>
                        <th style="width: 50%;padding-left: 35%">城市</th>
                        <th style="width: 50%;padding-right: 30%">酒店名称</th>
                        </thead>

                        <!--从数据库读取订单信息-->
                        <tbody>

                        <tr>
                            <td style="width: 50%;padding-left: 35%" th:text="${order.cityName}"></td>
                            <td th:text="${order.hotelName}"></td>
                        </tr>
                        </tbody>
                    </table>

            </div>

    </div>
</div>


<div class="living_middle" style="padding: 5em 0;">
    <div class="container"style="width:35%">
        <div class="col-md-12">

            <form th:action="@{/cityHotel/writeMessage}" method="post">
                <label >你的评论</label>
                <input hidden="hidden" th:value="${order.userId}" name="userId">
                <input hidden="hidden" th:value="${order.hotelId}" name="hotelId">
                <input type="text" id="messqge" name="Message" placeholder="写点什么......"
                style="width: 100%;
                padding: 16px 20px; ">

                <button name="submit" type="submit" class=" btn1 btn-2 btn-2g" value="提交" >提交</button>
                <!--<button name="submit" type="submit" class=" btn1 btn-2 btn-2g" value="提交" >返回</button>-->
            </form>
        </div>
    </div>
</div>





<div>


<div class="footer">
    <div class="container">
        <div class="footer_top">
            <h3>订阅我们的通知</h3>
            <form>
		<span>
			<i><img th:src="@{/images/mail.png}" alt=""></i>
		    <input type="text" value="请输入您的邮箱地址" onfocus="this.value = '';" onblur="if (this.value == '') {this.value = '请输入您的邮箱地址';}">
		    <label class="btn1 btn2 btn-2 btn-2g"> <input name="submit" type="submit" id="submit" value="订阅"> </label>
		    <div class="clearfix"> </div>
		</span>
            </form>
        </div>
        <div class="clearfix"> </div>
    </div>
</div>

</div>

</body>
<script>

    //点击城市信息下拉框查询
    $('#cityName').on('change',function () {
        var cityName = $(this).val();
        window.location.href='/cityHotel/hotelView?cityName='+cityName;
    })

    //点击酒店信息下拉框查询
    $('#hotelName').on('change',function () {
        var hotelName = $(this).val();
        window.location.href='/cityHotel/roomView?hotelName='+hotelName;
    })

    window.onload = function(){
        $.ajax({
            async:false,
            type:"POST",
            url:"/cityHotel/cityhotel",
            dataType:"json",
            data:{
                // warehouse: $("#cityName").val(),
            },
            success:function (data) {
                console.log(data);
                $("#cityName").append("<option>"+'选择'+"</option>option>");
                for (var i = 0; i<data.length;i++){
                    $("#cityName").append("<option >" + data[i].cityName + "</option>");

                }
            }
        })

        $.ajax({
            async:'true',
            type:"POST",
            url:"/cityHotel/hotel",
            dataType:"json",
            data:{
                // warehouse: $("#hotelName").val(),
            },
            success:function (data) {
                console.log(data);
                $("#hotelName").append("<option>"+'选择'+"</option>option>");
                for (var i = 0; i<data.length;i++){
                    $("#hotelName").append("<option >" + data[i].hotelName + "</option>");

                }
            }
        })
    }
</script>
</html>